import unittest
import requests
from util.RequestsUtil import RequestUtil
host = "https://api.xdclass.net"

class UserTestInfo(unittest.TestCase):
    def test_get_info(self):
        req = RequestUtil()
        url = host +"/pub/api/v1/web/user_info"
        headers = {"Content-Type": "application/x-www-form-urlencoded"}
        data ={"token":"xdclasseyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ4ZGNsYXNzIiwicm9sZXMiOiIxIiwiaW1nIjoiaHR0cHM6Ly94ZC12aWRlby1wYy1pbWcub3NzLWNuLWJlaWppbmcuYWxpeXVuY3MuY29tL3hkY2xhc3NfcHJvL2RlZmF1bHQvaGVhZF9pbWcvMjEuanBlZyIsImlkIjo2NzUwMjIsIm5hbWUiOiJkYXNkYWRhc2QxMTEiLCJpYXQiOjE2MTg0MDk0NzYsImV4cCI6MTYxOTAxNDI3Nn0.n98kfEPIQCxvS_ZKrdsDcF0Z_1IlTBp19kiirl0OaVs"}
        result= req.requesthandler(url,'get',headers=headers,param=data)
        print(result)

    # def test_get_info1(self,token):
    #     req = RequestUtil()
    #     url = host +"/pub/api/v1/web/user_info"
    #     headers = {"Content-Type": "application/x-www-form-urlencoded"}
    #     data ={"token":token}
    #     result= req.requesthandler(url,'get',headers=headers,param=data)
    #     print(result)

if __name__ == '__main__':
    unittest.main()
